require 'savon'


def testPRA
  client = Savon.client(wsdl: "http://soadv.ea.intropro.com/soa-infra/services/Content/ProcessRowAd/ProcessRowAd.service?WSDL", namespace: "http://directv.com/Content/Data/ContentMetadata")

  bmid = "X000000269"
  session_cat = "session"
  package_cat = "package"
  title_cat = "row_ad"
  media1_cat = "closed_WAIM0131115141305140"
  
  message = {"tns:MetadataProperties"=> {"MetadataProperty"=>[
                                         {"Name"=>"GeoID", "Category"=>session_cat, "Value"=>"PA"},
                                         {"Name"=>"SessionID", "Category"=>session_cat, "Value"=>(bmid + "_#{Time.now.tv_sec}" )},
                                        
                                         {"Name"=>"BaseMaterialID", "Category"=>package_cat, "Value"=>bmid},

                                         {"Name"=>"Asset_Class", "Category"=>title_cat, "Value"=>"row ad"},
                                        
                                         {"Name"=>"Asset_Class", "Category"=>media1_cat, "Value"=>"closed"},
                                         {"Name"=>"MaterialID_house", "Category"=>media1_cat, "Value"=>bmid+"R0"},
                                         {"Name"=>"FileLocationOriginal", "Category"=>media1_cat, "Value"=>"/opt/DIST/CableLabsFiles/dev_provider/original/WAMS/0131115141534811_IMG_04112013_151059/0131115141534811_IMG_04112013_151059.png"},
                                         {"Name"=>"FileLocationHouse", "Category"=>media1_cat, "Value"=>"/opt/DIST/CableLabsFiles/dev_provider/house/closed/2013_11/X000000269/X000000269R0/#{bmid}#{Time.now.tv_sec}G0.mpg"},
                                        
#                                          {"Name"=>"StatusCode", "Category"=>media1_cat + "_status_002", "Value"=>"CS_THUMBNAIL_READY"},
                                         {"Name"=>"StatusCode", "Category"=>media1_cat + "_status_019", "Value"=>"CS_COMPLETE_ON_AIR"},
                                                 
#                                          {"Name"=>"StatusCode", "Category"=>package_cat + "_status_002", "Value"=>"CS_THUMBNAIL_READY"},
                                         {"Name"=>"StatusCode", "Category"=>package_cat + "_status_019", "Value"=>"CS_COMPLETE_ON_AIR"}
                                         ]}}
  

  response = client.call(:process_row_ad_start, message: message)
  
end

